/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.gui.mvc.model.testbed;

import org.testis.gui.mvc.controller.testbed.DutController;
import org.testis.gui.mvc.model.AbstractModel;
import org.testis.orm.testbed.refined.DutRefined;

/**
 *
 * @author selcuk
 */
public class DutModel extends AbstractModel {

    private DutRefined m_DutRefined;
    private Integer m_dutId = 0;
    private String m_lastError = "";
    private Boolean m_visibility = false;
    private Integer m_testPcId = 0;
    private Integer m_deviceDefinitionId = 0;
    private Integer m_activeFirmwareId = 0;
    private String m_name = "";
    private String m_testBedIp = "";
    private Integer m_serialId = 0;
    private Integer m_dslamId = 0;
    private Boolean m_isSerialActive = false;

    public void setVisibility(Boolean val) {
        if (val == null) {
            return;
        }
        Boolean oldVal = m_visibility;
        m_visibility = val;
        firePropertyChange(DutController.VISIBLE_PROPERTY,
                oldVal,
                val);
    }

    public Boolean getVisibility() {
        return m_visibility;
    }

    public String getLastError() {
        return m_lastError;
    }

    public void setLastError(String val) {
        if (val == null) {
            val = "";
        }
        String oldValue = m_lastError;
        m_lastError = val;
        firePropertyChange(DutController.ERROR_PROPERTY, null,
                m_lastError);
    }

    /**
     * @return the m_deviceId
     */
    public Integer getDutId() {
        return m_dutId;
    }

    /**
     * @param val the m_deviceId to set
     */
    public void setDutId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_dutId;
        this.m_dutId = val;
        firePropertyChange(DutController.DUT_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_testPcId
     */
    public Integer getTestPcId() {
        return m_testPcId;
    }

    /**
     * @param val the m_testPcId to set
     */
    public void setTestPcId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_testPcId;
        this.m_testPcId = val;
        firePropertyChange(DutController.TEST_PC_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_deviceDefinitionId
     */
    public Integer getDeviceDefinitionId() {
        return m_deviceDefinitionId;
    }

    /**
     * @param val the m_deviceDefinitionId to set
     */
    public void setDeviceDefinitionId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_deviceDefinitionId;
        this.m_deviceDefinitionId = val;
        firePropertyChange(DutController.DEVICE_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_activeFirmwareId
     */
    public Integer getActiveFirmwareId() {
        return m_activeFirmwareId;
    }

    /**
     * @param val the m_activeFirmwareId to set
     */
    public void setActiveFirmwareId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_activeFirmwareId;
        this.m_activeFirmwareId = val;
        firePropertyChange(DutController.FIRMWARE_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_name
     */
    public String getName() {
        return m_name;
    }

    /**
     * @param val the m_name to set
     */
    public void setName(String val) {
        if (val == null) {
            val = "";
        }
        String oldVal = m_name;
        this.m_name = val;
        firePropertyChange(DutController.NAME_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_testBedIp
     */
    public String getTestBedIp() {
        return m_testBedIp;
    }

    /**
     * @param val the m_testBedIp to set
     */
    public void setTestBedIp(String val) {
        if (val == null) {
            val = "";
        }
        String oldVal = m_testBedIp;
        this.m_testBedIp = val;
        firePropertyChange(DutController.IP_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_serialId
     */
    public Integer getSerialId() {
        return m_serialId;
    }

    /**
     * @param val the m_serialId to set
     */
    public void setSerialId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_serialId;
        this.m_serialId = val;
        firePropertyChange(DutController.SERIAL_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_dslamId
     */
    public Integer getDslamId() {
        return m_dslamId;
    }

    /**
     * @param val the m_dslamId to set
     */
    public void setDslamId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_dslamId;
        this.m_dslamId = val;
        firePropertyChange(DutController.DSLAM_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_isSerialActive
     */
    public Boolean getIsSerialActive() {
        return m_isSerialActive;
    }

    /**
     * @param val the m_isSerialActive to set
     */
    public void setIsSerialActive(Boolean val) {
        if (val == null) {
            return;
        }
        Boolean oldVal = m_isSerialActive;
        this.m_isSerialActive = val;
        firePropertyChange(DutController.SERIAL_ACTIVE_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_DutRefined
     */
    public DutRefined getDutRefined() {
        return m_DutRefined;
    }

    /**
     * @param val the m_DutRefined to set
     */
    public void setDutRefined(DutRefined val) {
        if (val == null) {
            return;
        }
        DutRefined oldVal = m_DutRefined;
        this.m_DutRefined = val;
        firePropertyChange(DutController.DUT_REFINED_PROPERTY,
                null,
                val);
    }
}
